using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CodePlex.SpaceBlock;
using CodePlex.Resourceful;
using System.Diagnostics;
using CodePlex.Resourceful.Amazon.S3;
using CodePlex.Resourceful.Sun.CloudStorage;

namespace CodePlex.SpaceBlock.UI.Controls.Tools
{
    public partial class SunCloudSettingsControl : BaseControl
    {
      
        public SunCloudSettingsControl()
        {
            InitializeComponent();

            //_lookupLink.Text = Properties.Messages.Options_S3_AmazonLookup;
           // _createLink.Text = Properties.Messages.Options_S3_AmazonSignup;
            _lookupLink.Visible = false;
            _createLink.Visible = false;
            
            


        }

        public void Initialize(FileSystemInfo info)
        {
            // default service host = sun cloud host
            if (string.IsNullOrEmpty(info.PublicSettings.GetIfExists(UIConstants.SunCloudSettings.ServiceHost)))
            {
                info.PublicSettings[UIConstants.SunCloudSettings.ServiceHost] = SunCloudConstants.Host;
            }

            UIUtils.Bind(_idBox, info.PublicSettings, UIConstants.SunCloudSettings.AccessKeyID);
            UIUtils.Bind(_secretKeyBox, info.PrivateSettings, UIConstants.SunCloudSettings.SecretAccessKey);
            UIUtils.Bind(_useSSLCheck, info.PublicSettings, UIConstants.SunCloudSettings.UseSSL);
            UIUtils.Bind(_serviceHostBox, info.PublicSettings, UIConstants.SunCloudSettings.ServiceHost);
        }

        private void _lookupLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //Process.Start(Properties.Messages.Urls_Amazon_Lookup);
        }

        private void _createLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            //Process.Start(Properties.Messages.Urls_Amazon_Signup);
        }

       
    }
}

